Repository navigation
Conversation
…nd implement paginate
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
"post"(lowercase), so POST never matched. It now uses"POST". PUT, PATCH and DELETE still require a token.User.userNametousernameto match the routes and tests.badRequestimport from../lib/errors.paginate()to satisfypackages/shared/test/pagination.test.ts."types": ["bun-types"]sobun:testandprocessresolve.bun-typeswas already installed, so no dependency was added.Verification
bun test && tsc --noEmitpasses: 22 tests pass, 0 fail, and there are no type errors. No test files were modified.Assumptions / follow-ups
auth.tsand the README all say so. It does allow unauthenticated writes to/usersand/posts.paginate()does not validate its inputs. Following the "fix only what tests require" constraint, I didn't add validation; nothing callspaginate()yet. Before it is wired to query params, it should rejectpage < 1,size <= 0and non-integer values. For example, a negative page currently returns wrong items, and size 0 gives aNaNorInfinitypage count.// BUG:comments inauth.tsandusers.tswere left in place and are now outdated.